$(document).ready(function(){
       $('.liuyan_btn').click(function () {
        $(this).html("正在留言……");
        $(this).attr("disabled", "disabled");       
        var name = $('.msg_name').val();
        var mobile = $('.msg_mobile').val();
        var detail = $('.msg_detail').val();
        var type = $('.type').val();
        var id = $('.thisid').val();
        var title = $('.thistitle').val();
        var weid = $('.weid').val();
        var result = true;
        
        if (mobile.length != 11 || name == "") {
            alert("请留下您的姓名和手机以方便我联系您！");
            $(this).html("确认提交");
            $(this).removeAttr("disabled");
            return;
        }
                
        $.ajax({
            url: "liuyan.ashx",
            type: "POST",
            data: { name: name, mobile: mobile, detail: detail, title: title, type: type, id: id, weid: weid },
            dataType: "text",
            success: function (data) {
                alert("留言成功，感谢您的关注！");
                $('.msg_name').val("")
                $('.msg_mobile').val("")
                $('.msg_detail').val("")

            },
            error: function (data) {
                //alert(data.responseText);                       
            }
        });
        $(this).html("确认提交");
        $(this).removeAttr("disabled");

       });

       $('.btn-lg').click(function () {
           $(this).html("正在提交");
           $(this).attr("disabled", "disabled");
           var wechatid = $('.apply_wechatid').val();
          
           if (wechatid=="") {
               $(this).html("提交");
               $(this).removeAttr("disabled");
               return;
           }

           $.ajax({
               url: "weizhan/apply.ashx",
               type: "POST",
               data: { wechatid: wechatid},
               dataType: "text",
               success: function (data) {
                   alert("提交成功，感谢您的关注。请确保可通过该微信号搜索到您！");
                   $('.apply_wechatid').val("");
               },
               error: function (data) {                     
               }
           });
           $(this).html("提交");
           $(this).removeAttr("disabled");
       });

       $('.weixiu_btn').click(function () {
           $(this).html("正在留言……");
           $(this).attr("disabled", "disabled");
           var name = $('.name').val();
           var mobile = $('.mobile').val();
           var remark = $('.remark').val();          
           var id = $('.id').val();
           var weid = $('.weid').val();
           var result = true;

           if (mobile.length != 11 || name == "") {
               alert("亲，您是不是漏掉尊称或电话啦？");
               $(this).html("确认提交");
               $(this).removeAttr("disabled");
               return;
           }

           $.ajax({
               url: "weixiuliuyan.ashx",
               type: "POST",
               data: { name: name, mobile: mobile, remark: remark,  id: id, weid: weid },
               dataType: "text",
               success: function (data) {
                   alert("留言成功，感谢您的配合！\r\n\r\n您还可点击头像继续参观我的工作室");
                   $('.name').val("")
                   $('.mobile').val("")
                   $('.remark').val("")

               },
               error: function (data) {
                   //alert(data.responseText);                       
               }
           });
           $(this).html("确认提交");
           $(this).removeAttr("disabled");
           $('.look').hide();

       });

       $('.btn-lg').click(function () {
           $(this).html("正在提交");
           $(this).attr("disabled", "disabled");
           var wechatid = $('.apply_wechatid').val();

           if (wechatid == "") {
               $(this).html("提交");
               $(this).removeAttr("disabled");
               return;
           }

           $.ajax({
               url: "weizhan/apply.ashx",
               type: "POST",
               data: { wechatid: wechatid },
               dataType: "text",
               success: function (data) {
                   alert("提交成功，感谢您的关注。请确保可通过该微信号搜索到您！");
                   $('.apply_wechatid').val("");
               },
               error: function (data) {
               }
           });
           $(this).html("提交");
           $(this).removeAttr("disabled");
       });

})